package com.template.domain.entity;

import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import com.template.common.validgroup.Create;
import com.template.common.validgroup.Update;
import com.template.domain.entity.base.BaseEntity;
import com.template.config.mybatisflex.listener.MyInsertListener;
import com.template.config.mybatisflex.listener.MyUpdateListener;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 实体类。
 *
 * @author dong
 * @since 2023-09-03
 */
@Getter
@Setter
@Accessors(chain = true)
@Table(value = "sys_role", onInsert = MyInsertListener.class, onUpdate = MyUpdateListener.class)
public class SysRole extends BaseEntity {

    @Id
    @NotNull(groups = Update.class, message = "角色id为必要参数")
    private Long id;

    @NotBlank(groups = Create.class, message = "请输入角色名称")
    private String name;

    @NotBlank(groups = Create.class, message = "请输入角色标识符")
    private String code;

    private String remark;

    private Boolean status;

}
